package DataStorage;

import java.util.Date;
import org.dom4j.*;

import java.util.HashMap;
import java.util.Map;

public class XmlGenerate {


	@SuppressWarnings("deprecation")
	public boolean createXMLFile(String fileName){
		Date date = new Date(); 
		String nameXLS = fileName+".xsl";
		//create the document object
		Document document = DocumentHelper.createDocument();
		
		//processing Instruction
		Map<String, String> inMap = new HashMap<String,String>();
		inMap.put("type", "text/xsl");
		inMap.put("href", nameXLS);
		document.addProcessingInstruction("xml-stylesheet", inMap);
		
		//root element
		Element X91_2RD = document.addElement("X91_2RD");
		
		X91_2RD.addComment("this is used dom4j test for X91_2RD"+date.getDay());
		// A remplacer par Calendar.get(Calendar.DAY_OF_WEEK).
		
		//son element
		Element essieu = X91_2RD.addElement("essieu");
		essieu.addAttribute("Number", "299861");
		
		
		
		
		
		return false;
	}
	
	public boolean modifyXMLFile(){
		return false;
	}
	
	public static void main(String [] args){
		XmlGenerate xml = new XmlGenerate();
		xml.createXMLFile("X91-2RD");
	}

}
